# -*- coding: utf-8 -*-
"""
-------------------------------------------------
Project Name: luffcity study project
File Name: test2.py
Author: kij
Create Date: 2021/3/14
-------------------------------------------------
"""
import os

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
import sys

sys.path.append(BASE_DIR)
print(BASE_DIR)
result_list = {}
with open(os.path.join(BASE_DIR, "file", 'confing.txt'), mode='r') as file_obg:
	for line in file_obg:
		list_rest = line.split(":")
		result_list.setdefault(list_rest[0].strip(), "".join(list_rest[1:]).strip())
info = {}
map_key = {
	"Slot Number": "slot",
	"Raw Size": "capacity",
	"Inquiry Data": "model",
	"PD Type": "pd_type"
}
"""
info = {
    "slot":"1",
    "capacity":"279.396 GB",
    "model":"SEAGATE ST300MM0006     LS08S0K2B5NV",
    "pd_type":"SAS"
}
"""
for key, value in result_list.items():
	if key in map_key:
		info.setdefault(map_key[key], value)
print(info)

"""
{'slot': '1', 
'pd_type': 'SAS',
'capacity': '279.396 GB', 
'model': 'SEAGATE ST300MM0006     LS08S0K2B5NV'}
"""
